package com.ah.shanxi_demo.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 工单 扫描类型 枚举
 * @author zt 2020/8/24
 */
public enum OrderScanTypeEnum implements PolicyCommonInterface {

    //扫描类型
    SCAN_TYPE_1("1", "系统漏洞"),
    SCAN_TYPE_2("2", "Web应用漏洞"),
    SCAN_TYPE_3("3", "配置核查"),
    SCAN_TYPE_4("4", "弱口令"),
    ;

    private String key;
    private String value;

    final static Map<String, OrderScanTypeEnum> cacheOrderScan = new HashMap<>(values().length);

    static {
        for (OrderScanTypeEnum orderScanTypeEnum : values()) {
            cacheOrderScan.put(orderScanTypeEnum.key, orderScanTypeEnum);
        }
    }


    OrderScanTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static OrderScanTypeEnum convert(String key) {
        OrderScanTypeEnum type = cacheOrderScan.get(key);
        return type;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public Integer getKeyInt() {
        return Integer.parseInt(key);
    }
}

